// pages/wuliurongqiguanli/nav_check_gzcbl/check_gzcbl.js
const mybehavior = require("../../../../../behaviors/requests")
import Dialog from '@vant/weapp/dialog/dialog';
Page({

  /**
   * 页面的初始数据
   */
  behaviors: [mybehavior],
  data: {

    baseUrl: "https://logisticsengineering.gree.com/package_integrated_api/diy_frock_manage",
    list: [
      {
        v1: "K4107",
        v2: "C01531316",
        v3: "油分钣金件",
        v4: "08-09 09:02",
        v5: "陈增立",
        status: "已叫料",
      },
      {
        v1: "K4111",
        v2: "C01531316",
        v3: "油分钣金件",
        v4: "08-09 09:02",
        v5: "陈增立",
        status: "已接单",
      },
    ],
    btn_type: "default",
    btn_type1: "danger",
  },
  // 点击列
  onclick1(e) {
    console.log(e.currentTarget.dataset.row_data);
    let row = e.currentTarget.dataset.row_data
    console.log("123", row.status);
    if (row.status === "已叫料") {
      Dialog.confirm({
        message: '是否取消叫料？',
      })
        .then(() => {
          // on confirm
        })
        .catch(() => {
          // on cancel
        });
    }
  },
  btn1() {
    let type = this.data.btn_type
    if (type != "danger") {
      this.setData({
        btn_type: "danger",
        btn_type1: "default",
      })
      console.log("在叫料");
      wx.redirectTo({
        url: '/packageB/pages/package/lvkon/jiaoliao/jiaoliao',
      })
    }

  },
  btn2() {
    let type = this.data.btn_type1
    if (type != "danger") {
      this.setData({
        btn_type1: "danger",
        btn_type: "default",
      })
      console.log("已叫料");
      wx.redirectTo({
        url: '/packageB/pages/package/lvkon/yijiaoliao/yijiaoliao',
      })
    }

  },



  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})